home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / liboctave / ODEFunc.h < prev    next >
C/C++ Source or Header  |  1996-03-03  |  2KB  |  90 lines

  1. /*
  2.  
  3. Copyright (C) 1996 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. */
  22.  
  23. #if !defined (octave_ODEFunc_h)
  24. #define octave_ODEFunc_h 1
  25.  
  26. class Matrix;
  27. class ColumnVector;
  28.  
  29. class
  30. ODEFunc
  31. {
  32. public:
  33.  
  34.   typedef ColumnVector (*ODERHSFunc) (const ColumnVector&, double);
  35.   typedef Matrix (*ODEJacFunc) (const ColumnVector&, double);
  36.  
  37.   ODEFunc (void)
  38.     : fun (0), jac (0) { }
  39.  
  40.   ODEFunc (ODERHSFunc f)
  41.     : fun (f), jac (0) { }
  42.  
  43.   ODEFunc (ODERHSFunc f, ODEJacFunc j)
  44.     : fun (f), jac (j) { }
  45.  
  46.   ODEFunc (const ODEFunc& a)
  47.     : fun (a.fun), jac (a.jac) { }
  48.  
  49.   ODEFunc& operator = (const ODEFunc& a)
  50.     {
  51.       if (this != &a)
  52.     {
  53.       fun = a.fun;
  54.       jac = a.jac;
  55.     }
  56.       return *this;
  57.     }
  58.  
  59.   ~ODEFunc (void) { }
  60.  
  61.   ODERHSFunc function (void) const { return fun; }
  62.  
  63.   ODEFunc& set_function (ODERHSFunc f)
  64.     {
  65.       fun = f;
  66.       return *this;
  67.     }
  68.  
  69.   ODEJacFunc jacobian_function (void) const { return jac; }
  70.  
  71.   ODEFunc& set_jacobian_function (ODEJacFunc j)
  72.     {
  73.       jac = j;
  74.       return *this;
  75.     }
  76.  
  77. protected:
  78.  
  79.   ODERHSFunc fun;
  80.   ODEJacFunc jac;
  81. };
  82.  
  83. #endif
  84.  
  85. /*
  86. ;;; Local Variables: ***
  87. ;;; mode: C++ ***
  88. ;;; End: ***
  89. */
  90.